Computers include general purpose central processing units (CPUs) that are designed to execute a specific set of system instructions. A group of processors that have similar architecture or design specifications may be considered to be members of the same processor family. Examples of current processor families include the Motorola 680X0 processor family, manufactured by Motorola, Inc. of Phoenix, Ariz.; the Intel 80X86 processor family, manufactured by Intel Corporation of Sunnyvale, Calif.; and the PowerPC processor family, which is manufactured by Motorola, Inc. and used in computers manufactured by Apple Computer, Inc. of Cupertino, Calif. Although a group of processors may be in the same family because of their similar architecture and design considerations, processors may vary widely within a family according to their clock speed and other performance parameters.
Each family of microprocessors executes instructions that are unique to the processor family. The collective set of instructions that a processor or family of processors can execute is known as the processor's instruction set. As an example, the instruction set used by the Intel 80X86 processor family is incompatible with the instruction set used by the PowerPC processor family. The Intel 80X86 instruction set is based on the Complex Instruction Set Computer (CISC) format. The Motorola PowerPC instruction set is based on the Reduced Instruction Set Computer (RISC) format. CISC processors use a large number of instructions, some of which can perform rather complicated functions, but which require generally many clock cycles to execute. RISC processors use a smaller number of available instructions to perform a simpler set of functions that are executed at a much higher rate.
The uniqueness of the processor family among computer systems also typically results in incompatibility among the other elements of hardware architecture of the computer systems. A computer system manufactured with a processor from the Intel 80X86 processor family will have a hardware architecture that is different from the hardware architecture of a computer system manufactured with a processor from the PowerPC processor family. Because of the uniqueness of the processor instruction set and a computer system's hardware architecture, application software programs are typically written to run on a particular computer system running a particular operating system.
A computer manufacturer will attempt to maximize its market share by having more rather than fewer applications run on the microprocessor family associated with the computer manufacturer's product line. To expand the number of operating systems and application programs that can run on a computer system, a field of technology has developed in which a given computer having one type of CPU, called a host, will include an emulator program that allows the host computer to emulate the instructions of an unrelated type of CPU, called a guest. Thus, the host computer will execute an application that will cause one or more host instructions to be called in response to a given guest instruction. Thus, the host computer can both run software designed for its own hardware architecture and software written for computers having an unrelated hardware architecture. As a more specific example, a computer system manufactured by Apple Computer, for example, may run operating systems and program written for PC-based computer systems. It may also be possible to use an emulator program to operate concurrently on a single CPU multiple incompatible operating systems. In this arrangement, although each operating system is incompatible with the other, an emulator program can host one of the two operating systems, allowing the otherwise incompatible operating systems to run concurrently on the same computer system.
When a guest computer system is emulated on a host computer system, the guest computer system is said to be a virtual machine, as the guest computer system exists only as a software representation of the operation of the hardware architecture in the host computer system. The terms emulator and virtual machine are sometimes used interchangeably to denote the ability to mimic or emulate the hardware architecture of an entire computer system. As an example, the Virtual PC software created by Connectix Corporation of San Mateo, Calif. emulates an entire computer that includes an Intel 80X86 Pentium processor and various motherboard components and cards. The operation of these components is emulated in the virtual machine that is being run on the host machine. An emulator program executing on the operating system software and hardware architecture of the host computer, such as a computer system having a PowerPC processor, mimics the operation of the entire guest computer system. The emulator program acts as the interchange between the hardware architecture of the host machine and the instructions transmitted by the software running within the emulated environment.
The hard drives and floppy drives of a computer system are known as block devices. A block device is any device, including any memory device, within a computer system that transfers a defined minimum number of bytes of data as part of each access to the device. The defined minimum number of bytes of data is known as a sector or block. Data is stored in the block device in fixed size blocks or sectors of data. Each sector or block within a block device is the same size. In the case of a hard drive, each block or sector is typically 512 bytes in length. The entire block of data must be transferred in the case of an access to any single data element within the block. In the case of a hard drive, for example, the 512 bytes of data, the size of one block, must be passed to main memory, even if only a single byte of the block is part of the read operation. Thus, data must be read from or written to memory in multiples of the block size. Each block of the block device has a unique address. Each block of a block device can be accessed independently and in random access order. Typically, the addressing scheme will involve designating the first block as block 0. Successive blocks are consecutively numbered.
Emulated computer systems typically involve the use of a virtual hard drive image. Some emulated operating systems, such as some Windows operating systems, expect to boot from a hard drive that is a block device. To emulate for the guest operating system the presence of a physical hard drive, the emulation program creates a virtual hard drive image. The emulation program will present the virtual hard drive image to the guest operating system. The guest operating system will boot from the virtual hard drive image and will refer to the virtual hard drive image for all other functions necessitating reading from or writing to a hard drive. The virtual hard drive image often exists as a single file on the physical hard drive of the computer system. Thus, the entire content of the virtual hard drive of the guest computer system are represented as a single file on the physical hard drive of the computer system.
One possible format for a virtual hard drive is a single file that that has a fixed size, flat-mapped format in which the data of the virtual hard drive is laid out on physical hard drive by block address. The data at block 0 of the virtual hard drive is at the start of the file, and continues with the data for block 1 and the next successive blocks. For fixed size virtual hard drive images, the size of the file for the virtual hard drive is as large as the size of the hard drive being emulated. For example, a fixed size virtual hard drive that is 2 gigabytes (GB) in size will occupy a file on the physical hard drive of the computer system that is 2 GB in size.
A second possible format for a virtual hard drive is a single file that has a dynamically expanding format. The dynamically expanding file includes header information that describes the internal data structures of the file. Unlike the fixed size file, the only blocks that are included in the dynamically expanding file are those blocks that have been written to by the emulated computer system. Those blocks that have not been written to are not included in the dynamically expanding file and are assumed to be zeroed. Thus, if the emulated computer system attempts to read from a block of the dynamically expanding file that has not yet been written to, and is not represented in the dynamically expanding file, the emulation program will return to the emulated computer system a block containing all zeros. As new blocks are written to by the emulated computer system, the dynamically expanding file expands to accommodate the newly written block.
The header information of the dynamically expanding file identifies the location of each block in the file. Because blocks are not written to in a sequential manner that tracks the numbering scheme for the available blocks of the virtual hard drive, the header information will track the location of the blocks without regard to their sequential numbering scheme. For example, the data of block 0 may be placed adjacent to the data of block 100 and may be followed by the data of block 50. As such, the location of the blocks in the dynamically expanding file tracks the sequence the sequence that the blocks were written to, rather than tracking the sequence the sequential addressing scheme for the blocks. The header information also includes a bit map. Each bit on the bit map corresponds to an available block of the virtual hard drive. If a bit is a logical 1, the block corresponding to the bit has been written to, and therefore is included in the dynamically expanding file; If a bit is a logical 0, the block corresponding to the bit has not been written to, and is therefore not represented in the dynamically expanding file. Aside from the bit map technique for identifying written blocks in the virtual hard drive, other data structures may be used in the header information of the dynamically expanding file for coordinating the blocks of the virtual hard drive.